PROGRAM GENDAT;
VAR I:INTEGER;
    TABDAT:FILE OF INTEGER;
    TEXTDAT:TEXT;
BEGIN
     WRITELN('START TABDAT GENERATION');
     REWRITE(TABDAT,'#5:TABDAT.T');
     RESET(TEXTDAT,'#5:TEXTDAT.TEXT');
     I:=0;
     READ(TEXTDAT,TABDAT^);
     WHILE NOT EOF(TEXTDAT) DO
      BEGIN
           I:=SUCC(I);
           PUT(TABDAT);
           READ(TEXTDAT,TABDAT^);
      END;
     WRITELN;
     CLOSE(TABDAT,LOCK);
     WRITELN('END TABDAT GENERATION');
     WRITELN('THERE ARE ', I , ' NUMBERS GENERATED');
END.

